type Constructor<T = {}> = new (...args: any[]) => T;

function RecordStatus<T extends Constructor>(base: T) {
    return class extends base {
        private deleted: boolean = false;
        get Deleted(): boolean {
            return this.deleted;
        }

        Delete():void{
            this.deleted = true;
            console.log(`the record has been marked as deleted.`);
        }
    }
}

function TimeStamp<T extends Constructor>(base:T){
    return class extends base{
        Updated: Date = new Date();
    }
}

class Person{
    constructor(firstName: string,lastName: string){
        this.FirstName = firstName;
        this.LastName = lastName;
    }
    FirstName: string;
    LastName: string;
}

const ActivePerson = RecordStatus(TimeStamp(Person))

let activePErson = new ActivePerson("Peter","OLiray")

activePErson.Updated = new Date();
activePErson.Delete();

console.log(activePErson)
console.log(`${activePErson.Deleted}`)